package TP1.implementation;

import TP1.TDA.ColaTDA;

public class ColaArrayImpl1 implements ColaTDA {
	private int cant, index, vec[];
	private final int MAX = 100;

	public void inicializar() {
		cant = 0;
		index = 0;
		vec = new int[MAX];
	}

	public boolean vacia() {
		return (cant == 0);
	}

	public void acolar(int x) {
		// vec[index+cant] = x; //Si max fuese infinito
		vec[(index + cant) % MAX] = x;
		cant++;
	}

	public void desacolar() {
		// index = index + 1; //Si max fuese infinito
		index = (index + 1) % MAX;
		cant--;
	}

	public int primero() {
		return vec[index];
	}

}
